using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableUnionFightTransferDao:DaoBase<TableUnionFightTransfer>
    {
        public override void AddPrimaryIndex(TableUnionFightTransfer model)
        {
            cachePrimary[model.UFTransferId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableUnionFightTransfer.txt";
        }

        protected override TableUnionFightTransfer ParseRowData(string[] rowData)
        {
            TableUnionFightTransfer data = new TableUnionFightTransfer();
			data.UFTransferId = rowData [0];
			data.IconRes = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.TransferType = 0;
            }
            else
            {
                data.TransferType = int.Parse(rowData[2]);
            }
			data.TransferStart = rowData [3];

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.StartR = 0;
            }
            else
            {
                data.StartR = double.Parse(rowData[4]);
            }
			data.TransferEnd = rowData [5];

            if (string.IsNullOrEmpty(rowData[6]))
            {
                data.EndR = 0;
            }
            else
            {
                data.EndR = double.Parse(rowData[6]);
            }

            if (string.IsNullOrEmpty(rowData[7]))
            {
                data.TransferTime = 0;
            }
            else
            {
                data.TransferTime = double.Parse(rowData[7]);
            }

            if (string.IsNullOrEmpty(rowData[8]))
            {
                data.Camp = 0;
            }
            else
            {
                data.Camp = int.Parse(rowData[8]);
            }

            if (string.IsNullOrEmpty(rowData[9]))
            {
                data.PassRole = 0;
            }
            else
            {
                data.PassRole = int.Parse(rowData[9]);
            }

            if (string.IsNullOrEmpty(rowData[10]))
            {
                data.Gate = 0;
            }
            else
            {
                data.Gate = int.Parse(rowData[10]);
            }
			data.Target = rowData [11];

            return data;
        }



    }

}
